package cn.fl.system.service.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cmm.mid.core.framework.page.Pager;
import cn.cmm.base.framework.exception.BaseException;
import cn.cmm.base.framework.utils.StringUtils;
import cn.fl.system.condition.SysScoreIdxOptQueryCondition;
import cn.fl.system.dto.SysScoreIdxOptDTO;
import cn.fl.system.service.ISysScoreApiService;
import cn.fl.system.service.ISysScoreIdxOptService;
import cn.fl.system.transform.SysScoreIdxOptVOTransform;
import cn.fl.system.vo.SysScoreIdxOptVO;

/**
 * @Description: 评分模板指标选项表 客户端服务层接口实现
 */
@Service
public class SysScoreIdxOptServiceImpl implements ISysScoreIdxOptService {

	/**
	 * 日志
	 */
	@SuppressWarnings("unused")
	private static final Logger logger = LoggerFactory.getLogger(SysScoreIdxOptServiceImpl.class);
	/**
	 * 系统评分模版 API服务
	 */
	@Autowired
	private ISysScoreApiService sysScoreApiService;
	/**
	 * TODO 自定义 API 暴露服务
	 */
	//@Autowired
	//private I自定义ApiService 自定义ApiService;

	@Override
	public SysScoreIdxOptVO selectById(Long id) throws BaseException{
		if(StringUtils.isEmpty(id))return null;
		//TODO 业务逻辑
		SysScoreIdxOptDTO dto = null;//this.自定义ApiService.selectById(id);
		return SysScoreIdxOptVOTransform.toVO(dto);
	}

	@Override
	public Long add(SysScoreIdxOptVO entity) throws BaseException{
		if(null == entity)return null;
		//return this.sysScoreIdxOptApiService.add(SysScoreIdxOptVOTransform.toDTO(entity));
		//TODO 业务逻辑
		return this.sysScoreApiService.addSysScoreIdxOpt(SysScoreIdxOptVOTransform.toDTO(entity));
	}

	@Override
	public boolean removeById(Long id) throws BaseException{
		if(StringUtils.isEmpty(id))return false;
		//return this.sysScoreIdxOptApiService.removeById(id);
		//TODO 业务逻辑
		return this.sysScoreApiService.removeSysScoreIdxOptById(id);
	}
	@Override
	public boolean removeByIdxId(Long idxid) throws BaseException {
		// TODO Auto-generated method stub
		return this.sysScoreApiService.removeSysScoreIdxOptByIdxId(idxid);
	}
	@Override
	public boolean modify(SysScoreIdxOptVO entity) throws BaseException{
		if(null == entity)return false;
		//return this.sysScoreIdxOptApiService.modify(SysScoreIdxOptVOTransform.toDTO(entity));
		//TODO 业务逻辑
		return this.sysScoreApiService.modifySysScoreIdxOpt(SysScoreIdxOptVOTransform.toDTO(entity));
	}

	@Override
	public Pager searchListPage(Pager page) throws BaseException{
		if(null == page)page = new Pager();
		List<SysScoreIdxOptDTO> list=  this.sysScoreApiService.searchSysScoreIdxOptList((SysScoreIdxOptQueryCondition)page.getCondition());
		page.setResultList(list);
		//return this.sysScoreIdxOptApiService.searchListPage(page);
		//TODO 业务逻辑
		return page;
	}


}
